package com.iqik.rocket.dao;

import com.iqik.rocket.pojo.Order;
import com.iqik.rocket.pojo.OrderStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface OrderRepository extends JpaRepository<Order, String> {

    @Transactional
    @Modifying
    @Query("update Order set status= ?2 where id = ?1")
    void updateOrder(String id, OrderStatus status);

}
